package hk.linkcredit.walletservice.wallet.controller;


import hk.linkcredit.walletservice.model.Result;
import hk.linkcredit.walletservice.wallet.service.WalletFlowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 钱包流水表 前端控制器
 * </p>
 *
 * @author LinkCredit
 * @since 2022-06-10 15:18:10
 */
@RestController
@RequestMapping("/wallet-flow")
public class WalletFlowController {

    @Autowired
    WalletFlowService walletFlowService;

    /**
     * 根据客户号查询 获得的fundsType金额
     * @param custNo
     * @param flowType income/expend
     * @return
     */
    @GetMapping("/{custNo}/amount/{flowType}")
    public Result getAmountSumByFoundType(@PathVariable(name = "custNo") String custNo, @PathVariable(name = "fundsType") String flowType) {
        return Result.success(walletFlowService.getAmountSumByFoundType(custNo, flowType));
    }

}

